package test;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.transaction.TransactionConfiguration;

import com.code.base.sys.pojo.SysUser;
import com.code.base.sys.service.SysUserService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:config/applicationContext.xml"})
@TransactionConfiguration(transactionManager="transcationManager",defaultRollback=true)
public class SysTestCase {
	
	@Resource
	private SysUserService sysUserService;
	
//	@Test
	public void test() {
		SysUser u = new SysUser();
		List<SysUser> list = sysUserService.getDataByCondition(u);
		System.out.println(list.size());
	}
	
	@Test
	public void test2() {
		SysUser u = sysUserService.getDataById(1L);
		u.setUpdateTime(new Date());
		sysUserService.updateData(u);
	}
}
